<?php
/**
 * Extdb
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://code.google.com/p/extdb/wiki/NewBSDLicence
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Extdb
 * @package    Extdb
 * @copyright  Copyright (c) 2005-2008 ExtDb. (http://code.google.com/p/extdb/)
 * @license    http://code.google.com/p/extdb/wiki/NewBSDLicence New BSD License
 * @version    $Id: Exception.php 15 2009-07-29 21:45:57Z luke.richards.99 $
 */

/**
 * Base Exception Class.
 *
 * @category   Extdb
 * @package    Extdb
 * @copyright  Copyright (c) 2005-2008 ExtDb. (http://code.google.com/p/extdb/)
 * @license    http://code.google.com/p/extdb/wiki/NewBSDLicence New BSD License
 */
class Extdb_Exception extends Exception
{
    // client error statuses
    // The request contains bad syntax or cannot be fulfilled.
    const STATUS_CLIENT_BAD_REQUEST = 400;
    
    // Similar to 403 Forbidden, but specifically for use when authentication 
    // is possible but has failed or not yet been provided. The response must 
    // include a WWW-Authenticate header field containing a challenge applicable 
    // to the requested resource.
    const STATUS_CLIENT_UNAUTHORIZED = 401;

    // The original intention was that this code might be used as part of some
    // form of digital cash or micropayment scheme, but that has not happened,
    // and this code has never been used.
    const STATUS_CLIENT_PAYMENT_REQUIRED = 402;

    // The request was a legal request, but the server is refusing to respond
    // to it. Unlike a 401 Unauthorized response, authenticating will make no
    // difference.
    const STATUS_CLIENT_FORBIDDEN = 403;

    // The requested resource could not be found but may be available again in
    // the future. Subsequent requests by the client are permissible.
    const STATUS_CLIENT_NOT_FOUND  = 404;

    // A request was made of a resource using a request method not supported by
    // that resource; for example, using GET on a form which requires data to be
    // presented via POST, or using PUT on a read-only resource.
    const STATUS_CLIENT_METHOD_NOT_ALLOWED = 405;

    // The requested resource is only capable of generating content not
    // acceptable according to the Accept headers sent in the request.
    const STATUS_CLIENT_NOT_ACCEPTABLE = 406;
    
    // Proxy Authentication Required
    const STATUS_CLIENT_PROXY_AUTH_REQUIRED = 407;

    // The server timed out waiting for the request.
    const STATUS_CLIENT_REQUEST_TIMEOUT = 408;

    // Indicates that the request could not be processed because of conflict in
    // the request, such as an edit conflict.
    const STATUS_CLIENT_CONFLICT = 409;

    // Indicates that the resource requested is no longer available and will not
    // be available again. This should be used when a resource has been
    // intentionally removed; however, it is not necessary to return this code
    // and a 404 Not Found can be issued instead. Upon receiving a 410 status
    // code, the client should not request the resource again in the future.
    // Clients such as search engines should remove the resource from their
    // indexes.
    const STATUS_CLIENT_GONE = 410;

    // The request did not specify the length of its content, which is required
    // by the requested resource.
    const STATUS_CLIENT_LENGTH_REQUIRED = 411;

    // The server does not meet one of the preconditions that the requester put
    // on the request.
    const STATUS_CLIENT_PRECONDITION_FAILED = 412;

    // The request is larger than the server is willing or able to process.
    const STATUS_CLIENT_REQUEST_ENTITY_TOO_LARGE = 413;

    // The URI provided was too long for the server to process.
    const STATUS_CLIENT_REQUEST_URI_TOO_LONG = 414;

    // The request did not specify any media types that the server or resource
    // supports. For example the client specified that an image resource should
    // be served as image/svg+xml, but the server cannot find a matching version
    // of the image.
    const STATUS_CLIENT_UNSUPPORTED_MEDIA_TYPE = 415;

    // The client has asked for a portion of the file, but the server cannot
    // supply that portion (for example, if the client asked for a part of the
    // file that lies beyond the end of the file).
    const STATUS_CLIENT_REQUESTED_RANGE_NOT_SATISFIABLE = 416;

    // The server cannot meet the requirements of the Expect request-header
    // field.
    const STATUS_CLIENT_EXPECTATION_FAILED  = 417;
    
    // server error statuses
    // A generic error message, given when no more specific message is suitable.
    const STATUS_SERVER_INTERNAL_SERVER_ERROR = 500;

    // The server either does not recognise the request method, or it lacks the
    // ability to fulfil the request.
    const STATUS_SERVER_NOT_IMPLEMENTED = 501;

    // The server was acting as a gateway or proxy and received an invalid
    // response from the upstream server.
    const STATUS_SERVER_BAD_GATEWAY = 502;

    // The server is currently unavailable (because it is overloaded or down
    // for maintenance). Generally, this is a temporary state.
    const STATUS_SERVER_SERVICE_UNAVAILABLE = 503;

    // The server was acting as a gateway or proxy and did not receive a timely
    // request from the upstream server.
    const STATUS_SERVER_GATEWAY_TIMEOUT = 504;

    // The server does not support the HTTP protocol version used in the
    // request.
    const STATUS_SERVER_HTTP_VERSION_NOT_SUPPORTED = 505;

    // Transparent content negotiation for the request, results in a circular
    // reference.
    const STATUS_SERVER_VARIANT_ALSO_NEGOTIATES = 506;

    // Insufficient Storage (WebDAV) (RFC 4918 )
    const STATUS_SERVER_INSUFFICIENT_STORAGE = 507;

    // This status code, while used by many servers, is not specified in any
    // RFCs.
    const STATUS_SERVER_BANDWIDTH_LIMIT_EXCEEDED = 509;
    
    // Further extensions to the request are required for the server to fulfil
    // it.
    const STATUS_SERVER_NOT_EXTENDED = 510;
}